﻿using _16.策略模式.Base;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace _16.策略模式.Models
{
    /// <summary>
    /// 满减收费
    /// </summary>
    public class SubtractPay : PayBase
    {
        public int level = 0;
        public int subMoney = 0;
        public SubtractPay(int level, int subMoney)
        {
            this.level = level;
            this.subMoney = subMoney;
        }

        public override double Calc(double money)
        {
            int v = (int)(money / level);
            return money - v * subMoney;
        }
    }
}
